package cn.crm.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Province entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "PRO_PROVINCE")
public class Province implements java.io.Serializable {

	// Fields

	private Integer proCodeid;
	private Integer proParentid;
	private String proCityname;
	private Set<CustomerInfo> customerInfos = new HashSet<CustomerInfo>(0);

	// Constructors

	/** default constructor */
	public Province() {
	}

	/** minimal constructor */
	public Province(Integer proCodeid) {
		this.proCodeid = proCodeid;
	}

	/** full constructor */
	public Province(Integer proCodeid, Integer proParentid, String proCityname,
			Set<CustomerInfo> customerInfos) {
		this.proCodeid = proCodeid;
		this.proParentid = proParentid;
		this.proCityname = proCityname;
		this.customerInfos = customerInfos;
	}

	// Property accessors
	@Id
	@Column(name = "PRO_CODEID", unique = true, nullable = false, precision = 6, scale = 0)
	public Integer getProCodeid() {
		return this.proCodeid;
	}

	public void setProCodeid(Integer proCodeid) {
		this.proCodeid = proCodeid;
	}

	@Column(name = "PRO_PARENTID", precision = 6, scale = 0)
	public Integer getProParentid() {
		return this.proParentid;
	}

	public void setProParentid(Integer proParentid) {
		this.proParentid = proParentid;
	}

	@Column(name = "PRO_CITYNAME", length = 20)
	public String getProCityname() {
		return this.proCityname;
	}

	public void setProCityname(String proCityname) {
		this.proCityname = proCityname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "province")
	public Set<CustomerInfo> getCustomerInfos() {
		return this.customerInfos;
	}

	public void setCustomerInfos(Set<CustomerInfo> customerInfos) {
		this.customerInfos = customerInfos;
	}

}